import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import { Tabbar, TabbarItem, Toast } from 'vant';
import store from './store'
import httpUtil from './axios/base'

const app = createApp();
app.use(Toast);

app.config.globalProperties.$axios = axios
createApp(App).use(router).use(store).mount('#app')

const axiosIns = axios.create({
    baseURL: 'http://localhost:10010',
    timeout: 1000,
    headers: {'X-Custom-Header': 'foobar'}
})

axiosIns.interceptors.response.use(
    response => {
        const res = response;
        if(res.data.msg !== 1){
            Toast
        }
    }
)